{extend name="../../admin/view/main"}

{block name="button"}
{if isset($type) and $type eq 'index'}
<!--{if auth("remove")}-->
<button class='layui-btn layui-btn-sm layui-btn-primary'
        data-action='{:url("remove")}' data-rule="id#{key};deleted#1">删 除</button>
<!--{/if}-->
{else}
<!--{if auth("remove")}-->
<button class='layui-btn layui-btn-sm layui-btn-primary' data-action='{:url("remove")}'
        data-confirm="确定要恢复这些数据吗？" data-rule="id#{key};deleted#0">恢 复
</button>
<!--{/if}-->
{/if}
{/block}

{block name="content"}
<div class="layui-tab layui-tab-card think-bg-white">
    <ul class="layui-tab-title">
        {foreach ['index'=>'未 处 理','handle'=>'已 处 理','recycle'=>'回 收 站'] as $k=>$v}
        {if isset($type) and $type eq $k}
        <li class="layui-this" data-open="{:url('index')}?type={$k}">{$v}</li>
        {else}
        <li data-open="{:url('index')}?type={$k}">{$v}</li>
        {/if}{/foreach}
    </ul>
    <div class="layui-tab-content">
        {include file='opinion_list_controller/index_search'}
        <table class="layui-table margin-top-10" lay-skin="line">
            {notempty name='list'}
            <thead>
            <tr>
                <th class='list-table-check-td think-checkbox'>
                    <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
                </th>
                <th class='text-left nowrap'>用户</th>
                <th class='text-left nowrap'>应用</th>
                <th class='text-left nowrap'>建议</th>
                {if isset($type) and $type eq 'index'}
                {else}
                <th class='text-left nowrap'>操作人</th>
                <th class='text-left nowrap'>操作时间</th>
                {/if}
                <th class='text-left nowrap'>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
            <tr>
                <td class='list-table-check-td think-checkbox'>
                    <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>
                </td>
                <td class='nowrap'>
                    {foreach $users as $s}{eq name='vo.user_id' value='$s.id'}{$s.user_nickname}{/eq}{/foreach}
                </td>
                <td class='nowrap'>
                    {foreach $apps as $s}{eq name='vo.app_id' value='$s.app_id'}{$s.app_name}{/eq}{/foreach}
                </td>
                <td style="word-break: break-all;word-wrap:break-word;">{$vo.opinion_info|default='--'}</td>
                {if isset($type) and $type eq 'index'}
                {else}
                <td class='nowrap'>
                    {foreach $sysusers as $s}{eq name='vo.handle_userid' value='$s.id'}{$s.nickname}{/eq}{/foreach}
                </td>
                <td class='nowrap'>{$vo.handle_time|default='--'}</td>
                {/if}
                <td class='nowrap'>{$vo.create_time|default='--'}</td>

                <td class='nowrap sub-strong-blue'>
                    <!--{if auth("opiniontype")}-->
                    <a class="layui-btn layui-btn-xs" data-action="{:url('opiniontype')}"
                       data-value="id#{$vo.id};opinion_type#1">已处理</a>
                    <!--{/if}-->
                    {if isset($type) and $type eq 'index'}
                    <!--{if auth("remove")}-->
                    <a class="layui-btn layui-btn-xs layui-btn-danger" data-action="{:url('remove')}"
                       data-confirm="确定要移入回收站吗？" data-value="id#{$vo.id};deleted#1">删 除</a>
                    <!--{/if}-->
                    {else}
                    <!--{if auth("remove")}-->
                    <a class="layui-btn layui-btn-xs layui-btn-normal" data-action="{:url('remove')}"
                       data-value="id#{$vo.id};deleted#0">恢 复</a>
                    <!--{/if}-->
                    {/if}
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
    </div>
</div>

{/block}